<?php
/**
 * EsayADT 简单应用框架
 *  
 * @version   :  1.0
 * @author    :  sports98@gmail.com
 * @file      :  index.php
 * @createTime:  Wed Mar 03 09:26:13 CST 2010
 * 
 */
define("MD5LEN",32);
define("DEBUG",false);
define("TRHOWEXCEPTION",true);
$included = include "basefunction.php";
DEBUG && $script_time_s =microtime(true);
if(gettype($included)!= "boolean" && strlen($included)==MD5LEN){
	function &_tmain(){
		global $GO_CFG,$GO_RES;
		_load("config");//Load Config 
		$GO_CFG = new _cfg();
		_load("resource");//Load Resource
		$GO_RES = new _CNRES();
		_load('filter');//Load Filter
		$GO_FILTERS = new _Filter();
		_load('globalfunction');//Global function
		afxFilterData($GO_FILTERS,'GPRSC'); //Filter Variable
		_load('actions'); //Action Table
		$GO_ACTIONS = new _Actions();
		_load('adt');//load APP,DATABASE,TEMPLATE
		$GO_ADT = new _Adt();
		_load('factory');//load Factory
		$GO_FACTORY = new _Factory(time());
		$GO_FACTORY->appAction(&$GO_ACTIONS);
		register_app(&$GO_FACTORY,&$GO_ADT);//Send Adt to $Factory
		run_adt($GO_ADT);
		if(DEBUG)echo "<!--".__FUNCTION__." end-->";
	}
}
else{
	function _tmain(){
		echo "Init Error! please check this Applicatorn ! Can't run it!";
	}
}
session_start();
_tmain();
DEBUG && $script_time_e = microtime(true);
DEBUG && $tims = sprintf("\r\n<!--script run %.3f seconds-->",(float)$script_time_e-(float)$script_time_s);
if(DEBUG)echo $tims;
?>